package com.arron.adapter.objectdapter;

public class VoltageAdapter implements IVoltage5V {
    //合成复用原则-聚合关系
    private Voltage220V voltage220V;
    public VoltageAdapter(Voltage220V voltage220V) {
        this.voltage220V = voltage220V;
    }

    @Override
    public int output5V() {
        int dstV = 0;
        if(null!= voltage220V) {
            int srcV = voltage220V.output220();
            dstV = srcV / 44;
        }
        return dstV;
    }
}